home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / system / pc_dcl.zip / HELP / ON.HTX < prev    next >
Text File  |  1992-01-08  |  3KB  |  94 lines

  1. ON
  2.  
  3.  ON
  4.  
  5.      Performs a specified action  when  a  command or program executed
  6.      within a  command  procedure  encounters an error condition.  The
  7.      specified  actions are performed  only if the command interpreter
  8.      is enabled for error checking interrupts (the default conditions).
  9.      Use the ON command only in a command procedure.
  10.  
  11.      Format
  12.  
  13.        ON  condition THEN [$] command
  14.  
  15.      Additional information available:
  16.  
  17.        condition ON.condition      command ON.command      
  18.        Examples ON.Examples
  19.  
  20.  
  21. ON.condition
  22.  
  23.  ON
  24.  
  25.     condition
  26.  
  27.        Specifies either the severity level of an error interrupt.
  28.        Specify  one  of the following  keywords,  which  may  be
  29.        abbreviated to one or more characters:
  30.  
  31.        WARNING        Return status of warning occurs ($SEVERITY equals
  32.                       1).
  33.  
  34.        ERROR          Return status of error occurs ($SEVERITY equals 2).
  35.  
  36.        SEVERE_ERROR   Return status of error occurs ($SEVERITY equals 4).
  37.  
  38.        The default error condition is ON ERROR THEN EXIT.
  39.  
  40.  
  41. ON.command
  42.  
  43.  ON
  44.  
  45.     command
  46.  
  47.        Specifies the DCL command line to be executed. Optionally, you can
  48.        precede the command line with a dollar sign ($).
  49.  
  50.        If you specified an error condition as the condition parameter,
  51.        the action is taken when errors equal to or greater than the
  52.        specified level of error occur.
  53.  
  54. ON.Examples
  55.  
  56.  ON
  57.  
  58.  
  59.   Examples
  60.  
  61.  
  62.        1.  $ ON SEVERE_ERROR THEN CONTINUE
  63.  
  64.          A command procedure that contains this statement continues
  65.          to execute normally when a warning or error occurs during
  66.          execution. When a severe error occurs, the ON statement signals
  67.          the procedure to execute the next statement anyway. Once
  68.          the statement has been executed as a result of the severe
  69.          error condition, the default action (ON ERROR THEN EXIT) is
  70.          reinstated.
  71.  
  72.  
  73.  
  74.  
  75.        2.  $ ON WARNING THEN EXIT
  76.               .
  77.               .
  78.               .
  79.            $ SET NOON
  80.            $ RUN [SSTEST]LIBRA
  81.            $ SET ON
  82.               .
  83.               .
  84.               .
  85.  
  86.          The ON command requests that the procedure exit when any
  87.          warning, error, or severe error occurs. Later, the SET NOON
  88.          command disables error checking before executing the RUN
  89.          command. Regardless of any status code returned by the program
  90.          LIBRA.EXE, the procedure continues. The next command, SET ON,
  91.          reenables error checking and reestablishes the most recent ON
  92.          condition.
  93. 
  94.